package queue;

import java.util.LinkedList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:周次煜
 * Date: 2024-03-31
 * Time：21:51
 */
public class MyQueue implements IQueue {

    List<Integer> queue;

    public MyQueue() {
        queue= new LinkedList<>();
    }

    @Override
    public boolean offer(int val) {


        queue.add(val);

        return true;
    }


    @Override
    public int remove() {
        return queue.remove(0);
    }

    @Override
    public int peek() {
        return queue.get(0);
    }

    @Override
    public int size() {
        return queue.size();
    }


    public boolean isEmpty() {
        return queue.isEmpty();
    }
}
